package org.firebug.spring.boot.metadata.api.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 字典
 */
@Data
public class DictionarySaveVO implements Serializable {
    @NotNull(message = "pcode required")
    @Pattern(regexp = "^[0-9]{6}$", message = "pcode:^[0-9]{6}$")
    private String pcode;
    @NotNull(message = "code required")
    @Pattern(regexp = "^[0-9]{6}$", message = "code:^[0-9]{6}$")
    private String code;
    @NotNull(message = "name required")
    @Length(min = 1, max = 8, message = "name.length[1,8]")
    private String name;
    @NotNull(message = "value required")
    @Length(min = 1, max = 32, message = "value.length[1,32]")
    private String value;
    private byte sectors = 127;
    private boolean enabled = true;
}
